Skip to main content

ARDK for Android/com.nianticlabs.ardk.objectdetection/ObjectDetectionResult

ObjectDetectionResult

[androidJvm]
class ObjectDetectionResult(val awarenessParams: AwarenessImageParams, val numDetections: Int, val numClasses: Int, val boundingBoxLocations: FloatArray?, val probabilities: FloatArray?, val trackingIds: IntArray?, val imageParams: ObjectDetectionImageParams)

Wrapper for the native object detection result buffer.

Constructors​

ObjectDetectionResult[androidJvm]
constructor(awarenessParams: AwarenessImageParams, numDetections: Int, numClasses: Int, boundingBoxLocations: FloatArray?, probabilities: FloatArray?, trackingIds: IntArray?, imageParams: ObjectDetectionImageParams)

Properties​

NameSummary
awarenessParams[androidJvm]
val awarenessParams: AwarenessImageParams
Inference meta-data.
boundingBoxLocations[androidJvm]
val boundingBoxLocations: FloatArray?
Corner points of the bounding box. Length: numDetections * 4
imageParams[androidJvm]
val imageParams: ObjectDetectionImageParams
Dimensions of the source image and models input dimensions.
numClasses[androidJvm]
val numClasses: Int
The number of possible classifications per object.
numDetections[androidJvm]
val numDetections: Int
The number of detected objects.
probabilities[androidJvm]
val probabilities: FloatArray?
The probabilities (detection confidence) buffer. Length: numDetections * numClasses
trackingIds[androidJvm]
val trackingIds: IntArray?
Optional Ids for tracking the same object through inference frames. Length = numDetections

Functions​

NameSummary
toDetectedObjects[androidJvm]
fun ObjectDetectionResult.toDetectedObjects(confidenceThreshold: Float = 0.4f): List<DetectedObject>
Converts this ObjectDetectionResult into a list of strongly typed DetectedObject instances.